﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B303Langf.Parser.CodeGenerator
{
   public class EntityAddress
   {
      public EntityAddress( int level, int displacement )
      {
         Level = level;
         Displacement = displacement;
      }

      public EntityAddress( EntityAddress oldAddress, int increment )
      {
         Level = oldAddress.Level;
         Displacement = oldAddress.Displacement + increment;
      }

      public int Level
      {
         get;
         set;
      }

      public int Displacement
      {
         get;
         set;
      }

      public EntityAddress NextLevel()
      {
         return new EntityAddress( Level + 1, 0 );
      }
   }
}
